//write api here
import service from "@/utils/request.js";
export const projectApi = {
    list(projectQuery){
        return service.get('/project/list',{params:projectQuery});
    },
    deleteOne(id){
        return service.put(`/project/deleteOne/${id}`);
    },
    deleteAll(ids) {
        return service.put(`/project/deleteAll/${ids}`);
    },
    add(projectVO) {
        return service.put(`/project/add`, projectVO)
    },
    update(projectVO){
        return service.put('/project/update',projectVO)
    },
    getById(id){
        return service.get(`project/getById/${id}`)
    },
    updateStatus(projectVO){
        return service.put('/project/updateStatus',projectVO)
    },
    exportExcel() {
        return service({
            url: `/project/exportExcel`,
            method: 'get',
            //XMLHttpRequest 属性 responseType 是一个枚举字符串值，用于指定响应中包含的数据类型。
            //"blob": response 是一个包含二进制数据的 Blob 对象。
            responseType: 'blob'
        })
    },
    selectByContestId(id){
        return service.get(`/project/selectByContestId/${id}`)
    },
    exam(projectVO){
        return service.put(`/project/exam`, projectVO);
    },
    selectByRes(){
        return service.get(`/project/selectByRes`)
    },
    addByRes(researchersVo){
        return service.put(`project/addByRes`, researchersVo)
    }
}